import request from '@/utils/request'
export default {
    // GET / admin / product / baseSaleAttrList
    // 获取基础售卖属性列表
    getBaseSaleAttrList() {
        return request.get('/admin/product/baseSaleAttrList')
    },

    // 获取品牌列表
    // get/ admin / product / baseTrademark / getTrademarkList
    getTrademarkList: () => request.get('/admin/product/baseTrademark/getTrademarkList'),

    // /admin/product/deleteSpu/{spuId}
    // 删除某个spu
    deleteOneSpu: (spuId) => request.delete(`/admin/product/deleteSpu/${spuId}`),

    // POST / admin / product / saveSpuInfo
    // saveSpuInfo
    // POST / admin / product / updateSpuInfo
    // 更改spu信息
    //修改或者添加
    // saveSpuInfo: (spuInfo) => request.post('/admin/product/updateSpuInfo', spuInfo),
    saveSpuInfo: (spuInfo) => {
        // console.log(spuInfo,'..................');
        return request.post(`/admin/product/${spuInfo.id?'updateSpuInfo':'saveSpuInfo'}`, spuInfo)
    },

    // GET / admin / product / { page } / { limit }
    getSpuPageList: (page, limit, category3Id) => request.get(`/admin/product/${page}/${limit}?category3Id=${category3Id}`)
}